# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Stefan Tatschner <stefan@rumpelsepp.org>
# Contributor: kpcyrd <git@rxv.cc>

pkgname=websocat
pkgver=1.11.0
pkgrel=1
pkgdesc='Command-line client for web sockets, like netcat/curl/socat for ws://'
url='https://github.com/vi/websocat/'
arch=('loong64' 'x86_64')
license=('MIT')
depends=('glibc' 'openssl' 'gcc-libs')
makedepends=('cargo')
source=("${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha512sums=('94d5ab6f0a4903b64c1b5fede091d9229601e6680e265f3bdae0f0fa241248d763c30130b97fd50239542742d3334b672a72f4977294d3bce0a1dc8ad177db77')
b2sums=('c8e45c49a2c53cdf2976439eec98615d304d9a0feec1006ca714bcadd57d54c9d9772abf3ec56cd64c294d9aeaf8645439c0f756ad68847c69c5d5ad1f4121a6')

build() {
  cd "${pkgname}-${pkgver}"
  cargo build --release --locked --features=ssl
}

check() {
  cd "${pkgname}-${pkgver}"
  cargo test --release --locked --features=ssl
}

package() {
  cd "${pkgname}-${pkgver}"
  install -Dm 755 target/release/websocat -t "${pkgdir}/usr/bin"
  install -Dm 644 README.md doc.md -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et:
